import { Component,Input } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';


/**
 * Generated class for the QuestionCommodityPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */
@Component({
  selector: 'page-question-commodity',
  templateUrl: 'question-commodity.html',
})
export class QuestionCommodityPage {
  @Input() list;
  commodityNumber={
    number:1
  }
  constructor(public navCtrl: NavController, public navParams: NavParams) {

  }

  ionViewDidLoad() {
    //console.log('ionViewDidLoad QuestionCommodityPage');
  }

  add(index){
    this.commodityNumber.number++;
  }

  reduce(index){
    if (this.commodityNumber.number > 0 ){
      this.commodityNumber.number--;
    }

  }
}
